<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.fc.util.*" %>
<%@ page import="com.fc.model.Coach" %>
<%@ page import="com.fc.control.CoachControl" %>
<%@ page import = "com.fc.control.DateControl"%>



 <%
      request.setCharacterEncoding("UTF-8");
      int coachId=ParamUtil.getInt(request,"id",0);
      DateControl dc = new DateControl();
      Coach coach = new Coach();
	  String addtime = dc.Date();
	  //addtime = new String(request.getParameter("addtime").getBytes("iso8859-1"),"utf-8");
	  int store_id =Integer.parseInt(request.getParameter("store_id"));
	  int wages = Integer.parseInt(request.getParameter("wages"));
	  String type = new String(request.getParameter("type").getBytes("iso8859-1"),"utf-8");
	  //System.out.println(type);
	  int experience = Integer.parseInt(request.getParameter("experience"));
	  int price = Integer.parseInt(request.getParameter("price"));
	  String position = new String(request.getParameter("position").getBytes("iso8859-1"),"utf-8");
	  String idcard = new String(request.getParameter("idcard").getBytes("iso8859-1"),"utf-8");
	  String name = new String(request.getParameter("name").getBytes("iso8859-1"),"utf-8");
	  coach.setStore_id(store_id);
	  coach.setAddtime(addtime);
	  coach.setExperience(experience);
	  coach.setIdcard(idcard);
	  coach.setName(name);
	  coach.setPosition(position);
	  coach.setPrice(price);
	  coach.setType(type);
	  coach.setWages(wages);
	  boolean isSuccess = CoachControl.addCoach(coach);
	  String returnJson = "{\"status\":\"" + (isSuccess ?  1 : 0) + "\"}";
  %>
 <%=returnJson %>